<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>CryptoAuthLib: atcacert_def.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">CryptoAuthLib
   </div>
   <div id="projectbrief">Microchip CryptoAuthentication Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('a00149_source.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">atcacert_def.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="a00149.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#ifndef ATCACERT_DEF_H</span></div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#define ATCACERT_DEF_H</span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="preprocessor">#include &lt;stddef.h&gt;</span></div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="preprocessor">#include &lt;stdint.h&gt;</span></div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="a00131.html">atcacert.h</a>&quot;</span></div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="a00143.html">atcacert_date.h</a>&quot;</span></div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div><div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="a03534.html#ga5430f01929cd7269e04db08d1f28642f">   58</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">enum</span> <a class="code" href="a03534.html#ga5430f01929cd7269e04db08d1f28642f">atcacert_cert_type_e</a></div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;{</div><div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="a03534.html#gga5430f01929cd7269e04db08d1f28642fa82bc16ac5283813ee3ffe7cddf8e2b44">   60</a></span>&#160;    <a class="code" href="a03534.html#gga5430f01929cd7269e04db08d1f28642fa82bc16ac5283813ee3ffe7cddf8e2b44">CERTTYPE_X509</a>,  </div><div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="a03534.html#gga5430f01929cd7269e04db08d1f28642fa92c401741edaf606af7056851db7dddb">   61</a></span>&#160;    <a class="code" href="a03534.html#gga5430f01929cd7269e04db08d1f28642fa92c401741edaf606af7056851db7dddb">CERTTYPE_CUSTOM</a> </div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;} <a class="code" href="a03534.html#ga8fcfb1307197295422ace828b40ee37d">atcacert_cert_type_t</a>;</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div><div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="a03534.html#ga813047a656af7fe578d28fd54c840e8e">   67</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">enum</span> <a class="code" href="a03534.html#ga813047a656af7fe578d28fd54c840e8e">atcacert_cert_sn_src_e</a></div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;{</div><div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="a03534.html#gga813047a656af7fe578d28fd54c840e8ea1b3e4833214ba25ba3d665135b2b6cd1">   69</a></span>&#160;    <a class="code" href="a03534.html#gga813047a656af7fe578d28fd54c840e8ea1b3e4833214ba25ba3d665135b2b6cd1">SNSRC_STORED</a>             = 0x0, </div><div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="a03534.html#gga813047a656af7fe578d28fd54c840e8ea4c213faf0171fcc6aeb27a1ca344342b">   70</a></span>&#160;    <a class="code" href="a03534.html#gga813047a656af7fe578d28fd54c840e8ea4c213faf0171fcc6aeb27a1ca344342b">SNSRC_STORED_DYNAMIC</a>     = 0x7, </div><div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="a03534.html#gga813047a656af7fe578d28fd54c840e8ea338258d51f0eb1c5d7ef9f0e639f5e41">   71</a></span>&#160;    <a class="code" href="a03534.html#gga813047a656af7fe578d28fd54c840e8ea338258d51f0eb1c5d7ef9f0e639f5e41">SNSRC_DEVICE_SN</a>          = 0x8, </div><div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="a03534.html#gga813047a656af7fe578d28fd54c840e8eabda5814e7da6c10dc243749dea79ffff">   72</a></span>&#160;    <a class="code" href="a03534.html#gga813047a656af7fe578d28fd54c840e8eabda5814e7da6c10dc243749dea79ffff">SNSRC_SIGNER_ID</a>          = 0x9, </div><div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="a03534.html#gga813047a656af7fe578d28fd54c840e8ea5dadea2da6020b492727eb1da6c4bb1e">   73</a></span>&#160;    <a class="code" href="a03534.html#gga813047a656af7fe578d28fd54c840e8ea5dadea2da6020b492727eb1da6c4bb1e">SNSRC_PUB_KEY_HASH</a>       = 0xA, </div><div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="a03534.html#gga813047a656af7fe578d28fd54c840e8eaffba4ece10bc933c6b408a2b4e234ab2">   74</a></span>&#160;    <a class="code" href="a03534.html#gga813047a656af7fe578d28fd54c840e8eaffba4ece10bc933c6b408a2b4e234ab2">SNSRC_DEVICE_SN_HASH</a>     = 0xB, </div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="a03534.html#gga813047a656af7fe578d28fd54c840e8eacaf00502661bc7b9c260ca68831928b5">   75</a></span>&#160;    <a class="code" href="a03534.html#gga813047a656af7fe578d28fd54c840e8eacaf00502661bc7b9c260ca68831928b5">SNSRC_PUB_KEY_HASH_POS</a>   = 0xC, </div><div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="a03534.html#gga813047a656af7fe578d28fd54c840e8eab87e9124d93ca45243eacac5b96452b7">   76</a></span>&#160;    <a class="code" href="a03534.html#gga813047a656af7fe578d28fd54c840e8eab87e9124d93ca45243eacac5b96452b7">SNSRC_DEVICE_SN_HASH_POS</a> = 0xD, </div><div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="a03534.html#gga813047a656af7fe578d28fd54c840e8ea83bf725c47007c842da4a8e93b1bf972">   77</a></span>&#160;    <a class="code" href="a03534.html#gga813047a656af7fe578d28fd54c840e8ea83bf725c47007c842da4a8e93b1bf972">SNSRC_PUB_KEY_HASH_RAW</a>   = 0xE, </div><div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="a03534.html#gga813047a656af7fe578d28fd54c840e8ea2d608b2eeb6da309c1e9b2af7060d909">   78</a></span>&#160;    <a class="code" href="a03534.html#gga813047a656af7fe578d28fd54c840e8ea2d608b2eeb6da309c1e9b2af7060d909">SNSRC_DEVICE_SN_HASH_RAW</a> = 0xF  </div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;} <a class="code" href="a03534.html#gaa557358df9a164d6c1f14b1f53662c6c">atcacert_cert_sn_src_t</a>;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;</div><div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="a03534.html#ga1c0876228cb459f64347a63f3bae4c73">   84</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">enum</span> <a class="code" href="a03534.html#ga1c0876228cb459f64347a63f3bae4c73">atcacert_device_zone_e</a></div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;{</div><div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="a03534.html#gga1c0876228cb459f64347a63f3bae4c73a4856bc2fcbda0be68832968204126207">   86</a></span>&#160;    <a class="code" href="a03534.html#gga1c0876228cb459f64347a63f3bae4c73a4856bc2fcbda0be68832968204126207">DEVZONE_CONFIG</a> = 0x00,  </div><div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="a03534.html#gga1c0876228cb459f64347a63f3bae4c73ae42ffc066a13ac1f38195d2cf4e60cea">   87</a></span>&#160;    <a class="code" href="a03534.html#gga1c0876228cb459f64347a63f3bae4c73ae42ffc066a13ac1f38195d2cf4e60cea">DEVZONE_OTP</a>    = 0x01,  </div><div class="line"><a name="l00088"></a><span class="lineno"><a class="line" href="a03534.html#gga1c0876228cb459f64347a63f3bae4c73a774ecb8e950d309498a9aa64933d95cb">   88</a></span>&#160;    <a class="code" href="a03534.html#gga1c0876228cb459f64347a63f3bae4c73a774ecb8e950d309498a9aa64933d95cb">DEVZONE_DATA</a>   = 0x02,  </div><div class="line"><a name="l00089"></a><span class="lineno"><a class="line" href="a03534.html#gga1c0876228cb459f64347a63f3bae4c73afe6b6aedf2a765638f3c62817db11f05">   89</a></span>&#160;    <a class="code" href="a03534.html#gga1c0876228cb459f64347a63f3bae4c73afe6b6aedf2a765638f3c62817db11f05">DEVZONE_NONE</a>   = 0x07   </div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;} <a class="code" href="a03534.html#ga294899ca77a6801288e1ccb148de1f8b">atcacert_device_zone_t</a>;</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;</div><div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="a03534.html#ga77184d0c71198b489ea9b57d07da824e">   95</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">enum</span> <a class="code" href="a03534.html#ga77184d0c71198b489ea9b57d07da824e">atcacert_std_cert_element_e</a></div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;{</div><div class="line"><a name="l00097"></a><span class="lineno"><a class="line" href="a03534.html#gga77184d0c71198b489ea9b57d07da824eaf78a51bddeca05e1a525f26792b6de68">   97</a></span>&#160;    <a class="code" href="a03534.html#gga77184d0c71198b489ea9b57d07da824eaf78a51bddeca05e1a525f26792b6de68">STDCERT_PUBLIC_KEY</a>,</div><div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="a03534.html#gga77184d0c71198b489ea9b57d07da824ea8eab5679d330212bb87b2413ea82b7cc">   98</a></span>&#160;    <a class="code" href="a03534.html#gga77184d0c71198b489ea9b57d07da824ea8eab5679d330212bb87b2413ea82b7cc">STDCERT_SIGNATURE</a>,</div><div class="line"><a name="l00099"></a><span class="lineno"><a class="line" href="a03534.html#gga77184d0c71198b489ea9b57d07da824ea2f3039692a71546e581fcaf8a8a53f15">   99</a></span>&#160;    <a class="code" href="a03534.html#gga77184d0c71198b489ea9b57d07da824ea2f3039692a71546e581fcaf8a8a53f15">STDCERT_ISSUE_DATE</a>,</div><div class="line"><a name="l00100"></a><span class="lineno"><a class="line" href="a03534.html#gga77184d0c71198b489ea9b57d07da824ea886b91f34d6839fe9e9217490530c604">  100</a></span>&#160;    <a class="code" href="a03534.html#gga77184d0c71198b489ea9b57d07da824ea886b91f34d6839fe9e9217490530c604">STDCERT_EXPIRE_DATE</a>,</div><div class="line"><a name="l00101"></a><span class="lineno"><a class="line" href="a03534.html#gga77184d0c71198b489ea9b57d07da824eadfaaad6a933423f63fc3233bd84b90d3">  101</a></span>&#160;    <a class="code" href="a03534.html#gga77184d0c71198b489ea9b57d07da824eadfaaad6a933423f63fc3233bd84b90d3">STDCERT_SIGNER_ID</a>,</div><div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="a03534.html#gga77184d0c71198b489ea9b57d07da824ea73b3d53d4e70a48fd3fdeb0143493efc">  102</a></span>&#160;    <a class="code" href="a03534.html#gga77184d0c71198b489ea9b57d07da824ea73b3d53d4e70a48fd3fdeb0143493efc">STDCERT_CERT_SN</a>,</div><div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="a03534.html#gga77184d0c71198b489ea9b57d07da824ea6a9cddad9f6b552f0fe5f63fc57cf106">  103</a></span>&#160;    <a class="code" href="a03534.html#gga77184d0c71198b489ea9b57d07da824ea6a9cddad9f6b552f0fe5f63fc57cf106">STDCERT_AUTH_KEY_ID</a>,</div><div class="line"><a name="l00104"></a><span class="lineno"><a class="line" href="a03534.html#gga77184d0c71198b489ea9b57d07da824ea97400647cc539ce999c0b9f95d736585">  104</a></span>&#160;    <a class="code" href="a03534.html#gga77184d0c71198b489ea9b57d07da824ea97400647cc539ce999c0b9f95d736585">STDCERT_SUBJ_KEY_ID</a>,</div><div class="line"><a name="l00105"></a><span class="lineno"><a class="line" href="a03534.html#gga77184d0c71198b489ea9b57d07da824ead9a44768825ebcc67750d8e4172dc60f">  105</a></span>&#160;    <a class="code" href="a03534.html#gga77184d0c71198b489ea9b57d07da824ead9a44768825ebcc67750d8e4172dc60f">STDCERT_NUM_ELEMENTS</a>  </div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;} <a class="code" href="a03534.html#ga4889317187186736e62beb7538b870b2">atcacert_std_cert_element_t</a>;</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;<span class="comment">// Some of these structures may need to be byte-accurate</span></div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;<span class="preprocessor">#pragma pack(push, 1)</span></div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;</div><div class="line"><a name="l00115"></a><span class="lineno"><a class="line" href="a03591.html">  115</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="a03591.html">atcacert_device_loc_s</a></div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;{</div><div class="line"><a name="l00117"></a><span class="lineno"><a class="line" href="a03591.html#a107ad412023faa68c4ac0c7cfd921a02">  117</a></span>&#160;    <a class="code" href="a03534.html#ga294899ca77a6801288e1ccb148de1f8b">atcacert_device_zone_t</a> <a class="code" href="a03591.html#a107ad412023faa68c4ac0c7cfd921a02">zone</a>;        </div><div class="line"><a name="l00118"></a><span class="lineno"><a class="line" href="a03591.html#ad23984515efd99983fa4baf3754082a1">  118</a></span>&#160;    uint8_t                <a class="code" href="a03591.html#ad23984515efd99983fa4baf3754082a1">slot</a>;        </div><div class="line"><a name="l00119"></a><span class="lineno"><a class="line" href="a03591.html#ab0cedc80cd8670d02eee4b6e31500f5f">  119</a></span>&#160;    uint8_t                <a class="code" href="a03591.html#ab0cedc80cd8670d02eee4b6e31500f5f">is_genkey</a>;   </div><div class="line"><a name="l00120"></a><span class="lineno"><a class="line" href="a03591.html#ac681806181c80437cfab37335f62ff39">  120</a></span>&#160;    uint16_t               <a class="code" href="a03591.html#ac681806181c80437cfab37335f62ff39">offset</a>;      </div><div class="line"><a name="l00121"></a><span class="lineno"><a class="line" href="a03591.html#af6a39bfc7e1dc3b6f9c997c1c43fa996">  121</a></span>&#160;    uint16_t               <a class="code" href="a03591.html#af6a39bfc7e1dc3b6f9c997c1c43fa996">count</a>;       </div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;} <a class="code" href="a03534.html#ga0fb6e40d2f1496215af2f9ae23c861a0">atcacert_device_loc_t</a>;</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;</div><div class="line"><a name="l00127"></a><span class="lineno"><a class="line" href="a03595.html">  127</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="a03595.html">atcacert_cert_loc_s</a></div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;{</div><div class="line"><a name="l00129"></a><span class="lineno"><a class="line" href="a03595.html#ac681806181c80437cfab37335f62ff39">  129</a></span>&#160;    uint16_t <a class="code" href="a03595.html#ac681806181c80437cfab37335f62ff39">offset</a>;    </div><div class="line"><a name="l00130"></a><span class="lineno"><a class="line" href="a03595.html#af6a39bfc7e1dc3b6f9c997c1c43fa996">  130</a></span>&#160;    uint16_t <a class="code" href="a03595.html#af6a39bfc7e1dc3b6f9c997c1c43fa996">count</a>;     </div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;} <a class="code" href="a03534.html#gae7c32139e6dce0fe25b4598299a77df6">atcacert_cert_loc_t</a>;</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;</div><div class="line"><a name="l00136"></a><span class="lineno"><a class="line" href="a03599.html">  136</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="a03599.html">atcacert_cert_element_s</a></div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;{</div><div class="line"><a name="l00138"></a><span class="lineno"><a class="line" href="a03599.html#a0b1ca4dcd178907e4151c7132e3b55f5">  138</a></span>&#160;    <span class="keywordtype">char</span>                  <span class="keywordtype">id</span>[16];       </div><div class="line"><a name="l00139"></a><span class="lineno"><a class="line" href="a03599.html#aa36729eb861afe13bb70974147bc403b">  139</a></span>&#160;    <a class="code" href="a03591.html">atcacert_device_loc_t</a> <a class="code" href="a03599.html#aa36729eb861afe13bb70974147bc403b">device_loc</a>;   </div><div class="line"><a name="l00140"></a><span class="lineno"><a class="line" href="a03599.html#af74e55b0689356f989d8330ae3072376">  140</a></span>&#160;    <a class="code" href="a03595.html">atcacert_cert_loc_t</a>   <a class="code" href="a03599.html#af74e55b0689356f989d8330ae3072376">cert_loc</a>;     </div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;} <a class="code" href="a03534.html#ga8d14206d455a7a7835ed613e57c20dd3">atcacert_cert_element_t</a>;</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;</div><div class="line"><a name="l00149"></a><span class="lineno"><a class="line" href="a03603.html">  149</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="a03603.html">atcacert_def_s</a></div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;{</div><div class="line"><a name="l00151"></a><span class="lineno"><a class="line" href="a03603.html#ad158ea4479470d5470412d504428459b">  151</a></span>&#160;    <a class="code" href="a03534.html#ga8fcfb1307197295422ace828b40ee37d">atcacert_cert_type_t</a>           <a class="code" href="a03603.html#ad158ea4479470d5470412d504428459b">type</a>;                                    </div><div class="line"><a name="l00152"></a><span class="lineno"><a class="line" href="a03603.html#a44b6808e0d081cb5fd82f58f7de32e4a">  152</a></span>&#160;    uint8_t                        <a class="code" href="a03603.html#a44b6808e0d081cb5fd82f58f7de32e4a">template_id</a>;                             </div><div class="line"><a name="l00153"></a><span class="lineno"><a class="line" href="a03603.html#af383252a42d77882d0f3aac7f6ee5048">  153</a></span>&#160;    uint8_t                        <a class="code" href="a03603.html#af383252a42d77882d0f3aac7f6ee5048">chain_id</a>;                                </div><div class="line"><a name="l00154"></a><span class="lineno"><a class="line" href="a03603.html#a641e13598992fc536e70b55cc8ee2ea5">  154</a></span>&#160;    uint8_t                        <a class="code" href="a03603.html#a641e13598992fc536e70b55cc8ee2ea5">private_key_slot</a>;                        </div><div class="line"><a name="l00155"></a><span class="lineno"><a class="line" href="a03603.html#af44c31e823af19e6efe6b418a13fafe3">  155</a></span>&#160;    <a class="code" href="a03534.html#gaa557358df9a164d6c1f14b1f53662c6c">atcacert_cert_sn_src_t</a>         <a class="code" href="a03603.html#af44c31e823af19e6efe6b418a13fafe3">sn_source</a>;                               </div><div class="line"><a name="l00156"></a><span class="lineno"><a class="line" href="a03603.html#ab02a37cdd6671ab98d0124c5b91623b0">  156</a></span>&#160;    <a class="code" href="a03591.html">atcacert_device_loc_t</a>          <a class="code" href="a03603.html#ab02a37cdd6671ab98d0124c5b91623b0">cert_sn_dev_loc</a>;                         </div><div class="line"><a name="l00157"></a><span class="lineno"><a class="line" href="a03603.html#a61f951f9c4366391012057d591888f32">  157</a></span>&#160;    <a class="code" href="a03534.html#ga7f389df0f74fd3593ab7e3a4d380433f">atcacert_date_format_t</a>         <a class="code" href="a03603.html#a61f951f9c4366391012057d591888f32">issue_date_format</a>;                       </div><div class="line"><a name="l00158"></a><span class="lineno"><a class="line" href="a03603.html#a6367c516be990bdce86047b5d9acda14">  158</a></span>&#160;    <a class="code" href="a03534.html#ga7f389df0f74fd3593ab7e3a4d380433f">atcacert_date_format_t</a>         <a class="code" href="a03603.html#a6367c516be990bdce86047b5d9acda14">expire_date_format</a>;                      </div><div class="line"><a name="l00159"></a><span class="lineno"><a class="line" href="a03603.html#a3a8aede64cc4e17e9495ada7a64ab24f">  159</a></span>&#160;    <a class="code" href="a03595.html">atcacert_cert_loc_t</a>            <a class="code" href="a03603.html#a3a8aede64cc4e17e9495ada7a64ab24f">tbs_cert_loc</a>;                            </div><div class="line"><a name="l00160"></a><span class="lineno"><a class="line" href="a03603.html#a7dcbb1ab3db4003c7f2414e262853e6d">  160</a></span>&#160;    uint8_t                        <a class="code" href="a03603.html#a7dcbb1ab3db4003c7f2414e262853e6d">expire_years</a>;                            </div><div class="line"><a name="l00161"></a><span class="lineno"><a class="line" href="a03603.html#accd31930a2e1ff0b8122cbaa202127d3">  161</a></span>&#160;    <a class="code" href="a03591.html">atcacert_device_loc_t</a>          <a class="code" href="a03603.html#accd31930a2e1ff0b8122cbaa202127d3">public_key_dev_loc</a>;                      </div><div class="line"><a name="l00162"></a><span class="lineno"><a class="line" href="a03603.html#a2d5a033a5aa1227c536ec1aa71a84fa5">  162</a></span>&#160;    <a class="code" href="a03591.html">atcacert_device_loc_t</a>          <a class="code" href="a03603.html#a2d5a033a5aa1227c536ec1aa71a84fa5">comp_cert_dev_loc</a>;                       </div><div class="line"><a name="l00163"></a><span class="lineno"><a class="line" href="a03603.html#a7e2ecd6c0b4cef9637e3b281d29200ce">  163</a></span>&#160;    <a class="code" href="a03595.html">atcacert_cert_loc_t</a>            <a class="code" href="a03603.html#a7e2ecd6c0b4cef9637e3b281d29200ce">std_cert_elements</a>[<a class="code" href="a03534.html#gga77184d0c71198b489ea9b57d07da824ead9a44768825ebcc67750d8e4172dc60f">STDCERT_NUM_ELEMENTS</a>]; </div><div class="line"><a name="l00164"></a><span class="lineno"><a class="line" href="a03603.html#aa9a44f95411d86a78a93e650a9c19f53">  164</a></span>&#160;    <span class="keyword">const</span> <a class="code" href="a03599.html">atcacert_cert_element_t</a>* <a class="code" href="a03603.html#aa9a44f95411d86a78a93e650a9c19f53">cert_elements</a>;                           </div><div class="line"><a name="l00165"></a><span class="lineno"><a class="line" href="a03603.html#afe2b347e101c9f7be9f73b8fda53de29">  165</a></span>&#160;    uint8_t                        <a class="code" href="a03603.html#afe2b347e101c9f7be9f73b8fda53de29">cert_elements_count</a>;                     </div><div class="line"><a name="l00166"></a><span class="lineno"><a class="line" href="a03603.html#acb91631744ba06809269dc2f137c835c">  166</a></span>&#160;    <span class="keyword">const</span> uint8_t*                 <a class="code" href="a03603.html#acb91631744ba06809269dc2f137c835c">cert_template</a>;                           </div><div class="line"><a name="l00167"></a><span class="lineno"><a class="line" href="a03603.html#a67c40218f646b70740c0d2027eb152a0">  167</a></span>&#160;    uint16_t                       <a class="code" href="a03603.html#a67c40218f646b70740c0d2027eb152a0">cert_template_size</a>;                      </div><div class="line"><a name="l00168"></a><span class="lineno"><a class="line" href="a03603.html#aa5cb3f21e0d4d77567550388a7f08768">  168</a></span>&#160;    <span class="keyword">const</span> <span class="keyword">struct </span><a class="code" href="a03603.html">atcacert_def_s</a>*   <a class="code" href="a03603.html#aa5cb3f21e0d4d77567550388a7f08768">ca_cert_def</a>;                             </div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;} <a class="code" href="a03534.html#gae9e78b17340263e97844ccaf72ca16ac">atcacert_def_t</a>;</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;</div><div class="line"><a name="l00174"></a><span class="lineno"><a class="line" href="a03607.html">  174</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="a03607.html">atcacert_build_state_s</a></div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;{</div><div class="line"><a name="l00176"></a><span class="lineno"><a class="line" href="a03607.html#abaf4bb65d962f53a31b943c663eaf3b9">  176</a></span>&#160;    <span class="keyword">const</span> <a class="code" href="a03603.html">atcacert_def_t</a>* <a class="code" href="a03607.html#abaf4bb65d962f53a31b943c663eaf3b9">cert_def</a>;             </div><div class="line"><a name="l00177"></a><span class="lineno"><a class="line" href="a03607.html#aa09eb68c2656a44748cad406cf960f7c">  177</a></span>&#160;    uint8_t*              <a class="code" href="a03607.html#aa09eb68c2656a44748cad406cf960f7c">cert</a>;                 </div><div class="line"><a name="l00178"></a><span class="lineno"><a class="line" href="a03607.html#a083f29531821a0ef698b452cb2b7f5b4">  178</a></span>&#160;    <span class="keywordtype">size_t</span>*               <a class="code" href="a03607.html#a083f29531821a0ef698b452cb2b7f5b4">cert_size</a>;            </div><div class="line"><a name="l00179"></a><span class="lineno"><a class="line" href="a03607.html#abbc4bbcc72558a31f830df7df2df53b8">  179</a></span>&#160;    <span class="keywordtype">size_t</span>                <a class="code" href="a03607.html#abbc4bbcc72558a31f830df7df2df53b8">max_cert_size</a>;        </div><div class="line"><a name="l00180"></a><span class="lineno"><a class="line" href="a03607.html#a3969ddf030fd0524b62c572070bb3edc">  180</a></span>&#160;    uint8_t               <a class="code" href="a03607.html#a3969ddf030fd0524b62c572070bb3edc">is_device_sn</a>;         </div><div class="line"><a name="l00181"></a><span class="lineno"><a class="line" href="a03607.html#a5aa8a40126b53aa3748ba0d00de61e60">  181</a></span>&#160;    uint8_t               <a class="code" href="a03607.html#a5aa8a40126b53aa3748ba0d00de61e60">device_sn</a>[9];         </div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;} <a class="code" href="a03534.html#ga92ccf01a2c37be9caa7d840846672c83">atcacert_build_state_t</a>;</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;<span class="preprocessor">#pragma pack(pop)</span></div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;<span class="comment">// Inform function naming when compiling in C++</span></div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;<span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;</div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#ga84f1aeed7b88889d5bf01f21dbaaf398">atcacert_get_device_locs</a>(<span class="keyword">const</span> <a class="code" href="a03603.html">atcacert_def_t</a>*  cert_def,</div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;                             <a class="code" href="a03591.html">atcacert_device_loc_t</a>* device_locs,</div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;                             <span class="keywordtype">size_t</span>*                device_locs_count,</div><div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;                             <span class="keywordtype">size_t</span>                 device_locs_max_count,</div><div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;                             <span class="keywordtype">size_t</span>                 block_size);</div><div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;</div><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#gace8ac017f58840c296fe2cf29bdaa2fe">atcacert_cert_build_start</a>(<a class="code" href="a03607.html">atcacert_build_state_t</a>* build_state,</div><div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;                              <span class="keyword">const</span> <a class="code" href="a03603.html">atcacert_def_t</a>*   cert_def,</div><div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;                              uint8_t*                cert,</div><div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;                              <span class="keywordtype">size_t</span>*                 cert_size,</div><div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;                              <span class="keyword">const</span> uint8_t           ca_public_key[64]);</div><div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;</div><div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#ga626158cfe54b84903885b2cc6c3880e4">atcacert_cert_build_process</a>(<a class="code" href="a03607.html">atcacert_build_state_t</a>*      build_state,</div><div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;                                <span class="keyword">const</span> <a class="code" href="a03591.html">atcacert_device_loc_t</a>* device_loc,</div><div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;                                <span class="keyword">const</span> uint8_t*               device_data);</div><div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;</div><div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#ga9e594a491dccf61a638be46da5d40ff9">atcacert_cert_build_finish</a>(<a class="code" href="a03607.html">atcacert_build_state_t</a>* build_state);</div><div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;</div><div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#ga240f94a03feb298e5c618677f2962a5a">atcacert_get_device_data</a>(<span class="keyword">const</span> <a class="code" href="a03603.html">atcacert_def_t</a>*        cert_def,</div><div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;                             <span class="keyword">const</span> uint8_t*               cert,</div><div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;                             <span class="keywordtype">size_t</span>                       cert_size,</div><div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;                             <span class="keyword">const</span> <a class="code" href="a03591.html">atcacert_device_loc_t</a>* device_loc,</div><div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;                             uint8_t*                     device_data);</div><div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;</div><div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#ga4c4d5fe988ebface171689f3aa122e12">atcacert_set_subj_public_key</a>(<span class="keyword">const</span> <a class="code" href="a03603.html">atcacert_def_t</a>* cert_def,</div><div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;                                 uint8_t*              cert,</div><div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;                                 <span class="keywordtype">size_t</span>                cert_size,</div><div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;                                 <span class="keyword">const</span> uint8_t         subj_public_key[64]);</div><div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;</div><div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#gab4fac3fd2bf5a227140cc3012a4dad02">atcacert_get_subj_public_key</a>(<span class="keyword">const</span> <a class="code" href="a03603.html">atcacert_def_t</a> * cert_def,</div><div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;                                 <span class="keyword">const</span> uint8_t *        cert,</div><div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;                                 <span class="keywordtype">size_t</span>                 cert_size,</div><div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;                                 uint8_t                subj_public_key[64]);</div><div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;</div><div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#ga2843ebd40b7f0b6b4bf22cd447fa90e0">atcacert_get_subj_key_id</a>(<span class="keyword">const</span> <a class="code" href="a03603.html">atcacert_def_t</a> * cert_def,</div><div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;                             <span class="keyword">const</span> uint8_t *        cert,</div><div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;                             <span class="keywordtype">size_t</span>                 cert_size,</div><div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;                             uint8_t                subj_key_id[20]);</div><div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;</div><div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#gaf1f3cdf5e1e65c9abcbe98ae046d9bf2">atcacert_set_signature</a>(<span class="keyword">const</span> <a class="code" href="a03603.html">atcacert_def_t</a>* cert_def,</div><div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;                           uint8_t*              cert,</div><div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;                           <span class="keywordtype">size_t</span>*               cert_size,</div><div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;                           <span class="keywordtype">size_t</span>                max_cert_size,</div><div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;                           <span class="keyword">const</span> uint8_t         signature[64]);</div><div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;</div><div class="line"><a name="l00367"></a><span class="lineno">  367</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#gaf55b75df5e523e2d275ebb8cbe36fec6">atcacert_get_signature</a>(<span class="keyword">const</span> <a class="code" href="a03603.html">atcacert_def_t</a> * cert_def,</div><div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;                           <span class="keyword">const</span> uint8_t *        cert,</div><div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;                           <span class="keywordtype">size_t</span>                 cert_size,</div><div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;                           uint8_t                signature[64]);</div><div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;</div><div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#ga36d4893ccd152a8ec18f84f90a5e3cb5">atcacert_set_issue_date</a>(<span class="keyword">const</span> <a class="code" href="a03603.html">atcacert_def_t</a>*    cert_def,</div><div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;                            uint8_t*                 cert,</div><div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;                            <span class="keywordtype">size_t</span>                   cert_size,</div><div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;                            <span class="keyword">const</span> <a class="code" href="a03587.html">atcacert_tm_utc_t</a>* timestamp);</div><div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;</div><div class="line"><a name="l00399"></a><span class="lineno">  399</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#ga51f7b996909bc9cae783bcaf0fe7082b">atcacert_get_issue_date</a>(<span class="keyword">const</span> <a class="code" href="a03603.html">atcacert_def_t</a>* cert_def,</div><div class="line"><a name="l00400"></a><span class="lineno">  400</span>&#160;                            <span class="keyword">const</span> uint8_t*        cert,</div><div class="line"><a name="l00401"></a><span class="lineno">  401</span>&#160;                            <span class="keywordtype">size_t</span>                cert_size,</div><div class="line"><a name="l00402"></a><span class="lineno">  402</span>&#160;                            <a class="code" href="a03587.html">atcacert_tm_utc_t</a>*    timestamp);</div><div class="line"><a name="l00403"></a><span class="lineno">  403</span>&#160;</div><div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#gad499cd0bdce799a3278f99c80e0f9143">atcacert_set_expire_date</a>(<span class="keyword">const</span> <a class="code" href="a03603.html">atcacert_def_t</a>*    cert_def,</div><div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160;                             uint8_t*                 cert,</div><div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;                             <span class="keywordtype">size_t</span>                   cert_size,</div><div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;                             <span class="keyword">const</span> <a class="code" href="a03587.html">atcacert_tm_utc_t</a>* timestamp);</div><div class="line"><a name="l00419"></a><span class="lineno">  419</span>&#160;</div><div class="line"><a name="l00431"></a><span class="lineno">  431</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#ga8d1d761d35cf36feea5c626bb1d70ab2">atcacert_get_expire_date</a>(<span class="keyword">const</span> <a class="code" href="a03603.html">atcacert_def_t</a>* cert_def,</div><div class="line"><a name="l00432"></a><span class="lineno">  432</span>&#160;                             <span class="keyword">const</span> uint8_t*        cert,</div><div class="line"><a name="l00433"></a><span class="lineno">  433</span>&#160;                             <span class="keywordtype">size_t</span>                cert_size,</div><div class="line"><a name="l00434"></a><span class="lineno">  434</span>&#160;                             <a class="code" href="a03587.html">atcacert_tm_utc_t</a>*    timestamp);</div><div class="line"><a name="l00435"></a><span class="lineno">  435</span>&#160;</div><div class="line"><a name="l00446"></a><span class="lineno">  446</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#ga82ca7cff42ee4496a40076faac7ff6f6">atcacert_set_signer_id</a>(<span class="keyword">const</span> <a class="code" href="a03603.html">atcacert_def_t</a>* cert_def,</div><div class="line"><a name="l00447"></a><span class="lineno">  447</span>&#160;                           uint8_t*              cert,</div><div class="line"><a name="l00448"></a><span class="lineno">  448</span>&#160;                           <span class="keywordtype">size_t</span>                cert_size,</div><div class="line"><a name="l00449"></a><span class="lineno">  449</span>&#160;                           <span class="keyword">const</span> uint8_t         signer_id[2]);</div><div class="line"><a name="l00450"></a><span class="lineno">  450</span>&#160;</div><div class="line"><a name="l00461"></a><span class="lineno">  461</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#ga1201f3c1a20b5b105f9160bea104b102">atcacert_get_signer_id</a>(<span class="keyword">const</span> <a class="code" href="a03603.html">atcacert_def_t</a> * cert_def,</div><div class="line"><a name="l00462"></a><span class="lineno">  462</span>&#160;                           <span class="keyword">const</span> uint8_t *        cert,</div><div class="line"><a name="l00463"></a><span class="lineno">  463</span>&#160;                           <span class="keywordtype">size_t</span>                 cert_size,</div><div class="line"><a name="l00464"></a><span class="lineno">  464</span>&#160;                           uint8_t                signer_id[2]);</div><div class="line"><a name="l00465"></a><span class="lineno">  465</span>&#160;</div><div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#ga0a5a5fb234b9aa7093ae3a0bb2785f73">atcacert_set_cert_sn</a>(<span class="keyword">const</span> <a class="code" href="a03603.html">atcacert_def_t</a>* cert_def,</div><div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160;                         uint8_t*              cert,</div><div class="line"><a name="l00480"></a><span class="lineno">  480</span>&#160;                         <span class="keywordtype">size_t</span>*               cert_size,</div><div class="line"><a name="l00481"></a><span class="lineno">  481</span>&#160;                         <span class="keywordtype">size_t</span>                max_cert_size,</div><div class="line"><a name="l00482"></a><span class="lineno">  482</span>&#160;                         <span class="keyword">const</span> uint8_t*        cert_sn,</div><div class="line"><a name="l00483"></a><span class="lineno">  483</span>&#160;                         <span class="keywordtype">size_t</span>                cert_sn_size);</div><div class="line"><a name="l00484"></a><span class="lineno">  484</span>&#160;</div><div class="line"><a name="l00502"></a><span class="lineno">  502</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#gae1f109cb8edea615c0f7126527208452">atcacert_gen_cert_sn</a>(<span class="keyword">const</span> <a class="code" href="a03603.html">atcacert_def_t</a>* cert_def,</div><div class="line"><a name="l00503"></a><span class="lineno">  503</span>&#160;                         uint8_t*              cert,</div><div class="line"><a name="l00504"></a><span class="lineno">  504</span>&#160;                         <span class="keywordtype">size_t</span>                cert_size,</div><div class="line"><a name="l00505"></a><span class="lineno">  505</span>&#160;                         <span class="keyword">const</span> uint8_t         device_sn[9]);</div><div class="line"><a name="l00506"></a><span class="lineno">  506</span>&#160;</div><div class="line"><a name="l00519"></a><span class="lineno">  519</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#gaf64c228c28f42f15e9b43457146d1504">atcacert_get_cert_sn</a>(<span class="keyword">const</span> <a class="code" href="a03603.html">atcacert_def_t</a>* cert_def,</div><div class="line"><a name="l00520"></a><span class="lineno">  520</span>&#160;                         <span class="keyword">const</span> uint8_t*        cert,</div><div class="line"><a name="l00521"></a><span class="lineno">  521</span>&#160;                         <span class="keywordtype">size_t</span>                cert_size,</div><div class="line"><a name="l00522"></a><span class="lineno">  522</span>&#160;                         uint8_t*              cert_sn,</div><div class="line"><a name="l00523"></a><span class="lineno">  523</span>&#160;                         <span class="keywordtype">size_t</span>*               cert_sn_size);</div><div class="line"><a name="l00524"></a><span class="lineno">  524</span>&#160;</div><div class="line"><a name="l00537"></a><span class="lineno">  537</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#ga7b22f63ccda2cba10d5ca3dd9c39a06c">atcacert_set_auth_key_id</a>(<span class="keyword">const</span> <a class="code" href="a03603.html">atcacert_def_t</a>* cert_def,</div><div class="line"><a name="l00538"></a><span class="lineno">  538</span>&#160;                             uint8_t*              cert,</div><div class="line"><a name="l00539"></a><span class="lineno">  539</span>&#160;                             <span class="keywordtype">size_t</span>                cert_size,</div><div class="line"><a name="l00540"></a><span class="lineno">  540</span>&#160;                             <span class="keyword">const</span> uint8_t         auth_public_key[64]);</div><div class="line"><a name="l00541"></a><span class="lineno">  541</span>&#160;</div><div class="line"><a name="l00552"></a><span class="lineno">  552</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#ga94a3b57e412fe2cfddf92fdc8e54a41e">atcacert_set_auth_key_id_raw</a>(<span class="keyword">const</span> <a class="code" href="a03603.html">atcacert_def_t</a>* cert_def,</div><div class="line"><a name="l00553"></a><span class="lineno">  553</span>&#160;                                 uint8_t*              cert,</div><div class="line"><a name="l00554"></a><span class="lineno">  554</span>&#160;                                 <span class="keywordtype">size_t</span>                cert_size,</div><div class="line"><a name="l00555"></a><span class="lineno">  555</span>&#160;                                 <span class="keyword">const</span> uint8_t*        auth_key_id);</div><div class="line"><a name="l00556"></a><span class="lineno">  556</span>&#160;</div><div class="line"><a name="l00567"></a><span class="lineno">  567</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#gadf6c26dd4333931acf2b8f6ac9a5f422">atcacert_get_auth_key_id</a>(<span class="keyword">const</span> <a class="code" href="a03603.html">atcacert_def_t</a> * cert_def,</div><div class="line"><a name="l00568"></a><span class="lineno">  568</span>&#160;                             <span class="keyword">const</span> uint8_t *        cert,</div><div class="line"><a name="l00569"></a><span class="lineno">  569</span>&#160;                             <span class="keywordtype">size_t</span>                 cert_size,</div><div class="line"><a name="l00570"></a><span class="lineno">  570</span>&#160;                             uint8_t                auth_key_id[20]);</div><div class="line"><a name="l00571"></a><span class="lineno">  571</span>&#160;</div><div class="line"><a name="l00587"></a><span class="lineno">  587</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#ga2e2c59c41193e71b1a4b96f58642bb49">atcacert_set_comp_cert</a>(<span class="keyword">const</span> <a class="code" href="a03603.html">atcacert_def_t</a>* cert_def,</div><div class="line"><a name="l00588"></a><span class="lineno">  588</span>&#160;                           uint8_t*              cert,</div><div class="line"><a name="l00589"></a><span class="lineno">  589</span>&#160;                           <span class="keywordtype">size_t</span>*               cert_size,</div><div class="line"><a name="l00590"></a><span class="lineno">  590</span>&#160;                           <span class="keywordtype">size_t</span>                max_cert_size,</div><div class="line"><a name="l00591"></a><span class="lineno">  591</span>&#160;                           <span class="keyword">const</span> uint8_t         comp_cert[72]);</div><div class="line"><a name="l00592"></a><span class="lineno">  592</span>&#160;</div><div class="line"><a name="l00603"></a><span class="lineno">  603</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#ga9a7903692035d06b5d1a45c3b56fce3a">atcacert_get_comp_cert</a>(<span class="keyword">const</span> <a class="code" href="a03603.html">atcacert_def_t</a> * cert_def,</div><div class="line"><a name="l00604"></a><span class="lineno">  604</span>&#160;                           <span class="keyword">const</span> uint8_t *        cert,</div><div class="line"><a name="l00605"></a><span class="lineno">  605</span>&#160;                           <span class="keywordtype">size_t</span>                 cert_size,</div><div class="line"><a name="l00606"></a><span class="lineno">  606</span>&#160;                           uint8_t                comp_cert[72]);</div><div class="line"><a name="l00607"></a><span class="lineno">  607</span>&#160;</div><div class="line"><a name="l00619"></a><span class="lineno">  619</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#ga9883eaf43aa94e7a29c1bdf13514185c">atcacert_get_tbs</a>(<span class="keyword">const</span> <a class="code" href="a03603.html">atcacert_def_t</a>* cert_def,</div><div class="line"><a name="l00620"></a><span class="lineno">  620</span>&#160;                     <span class="keyword">const</span> uint8_t*        cert,</div><div class="line"><a name="l00621"></a><span class="lineno">  621</span>&#160;                     <span class="keywordtype">size_t</span>                cert_size,</div><div class="line"><a name="l00622"></a><span class="lineno">  622</span>&#160;                     <span class="keyword">const</span> uint8_t**       tbs,</div><div class="line"><a name="l00623"></a><span class="lineno">  623</span>&#160;                     <span class="keywordtype">size_t</span>*               tbs_size);</div><div class="line"><a name="l00624"></a><span class="lineno">  624</span>&#160;</div><div class="line"><a name="l00635"></a><span class="lineno">  635</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#ga0b2fd4ca54a1fde2d0d669b1fc11284a">atcacert_get_tbs_digest</a>(<span class="keyword">const</span> <a class="code" href="a03603.html">atcacert_def_t</a> * cert_def,</div><div class="line"><a name="l00636"></a><span class="lineno">  636</span>&#160;                            <span class="keyword">const</span> uint8_t *        cert,</div><div class="line"><a name="l00637"></a><span class="lineno">  637</span>&#160;                            <span class="keywordtype">size_t</span>                 cert_size,</div><div class="line"><a name="l00638"></a><span class="lineno">  638</span>&#160;                            uint8_t                tbs_digest[32]);</div><div class="line"><a name="l00639"></a><span class="lineno">  639</span>&#160;</div><div class="line"><a name="l00653"></a><span class="lineno">  653</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#ga5dacb3927ef7eacfaf8c4e28641f7bce">atcacert_set_cert_element</a>(<span class="keyword">const</span> <a class="code" href="a03603.html">atcacert_def_t</a>*      cert_def,</div><div class="line"><a name="l00654"></a><span class="lineno">  654</span>&#160;                              <span class="keyword">const</span> <a class="code" href="a03595.html">atcacert_cert_loc_t</a>* cert_loc,</div><div class="line"><a name="l00655"></a><span class="lineno">  655</span>&#160;                              uint8_t*                   cert,</div><div class="line"><a name="l00656"></a><span class="lineno">  656</span>&#160;                              <span class="keywordtype">size_t</span>                     cert_size,</div><div class="line"><a name="l00657"></a><span class="lineno">  657</span>&#160;                              <span class="keyword">const</span> uint8_t*             data,</div><div class="line"><a name="l00658"></a><span class="lineno">  658</span>&#160;                              <span class="keywordtype">size_t</span>                     data_size);</div><div class="line"><a name="l00659"></a><span class="lineno">  659</span>&#160;</div><div class="line"><a name="l00673"></a><span class="lineno">  673</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#gacdb102fcae9f3a822a19b2ca487b415d">atcacert_get_cert_element</a>(<span class="keyword">const</span> <a class="code" href="a03603.html">atcacert_def_t</a>*      cert_def,</div><div class="line"><a name="l00674"></a><span class="lineno">  674</span>&#160;                              <span class="keyword">const</span> <a class="code" href="a03595.html">atcacert_cert_loc_t</a>* cert_loc,</div><div class="line"><a name="l00675"></a><span class="lineno">  675</span>&#160;                              <span class="keyword">const</span> uint8_t*             cert,</div><div class="line"><a name="l00676"></a><span class="lineno">  676</span>&#160;                              <span class="keywordtype">size_t</span>                     cert_size,</div><div class="line"><a name="l00677"></a><span class="lineno">  677</span>&#160;                              uint8_t*                   data,</div><div class="line"><a name="l00678"></a><span class="lineno">  678</span>&#160;                              <span class="keywordtype">size_t</span>                     data_size);</div><div class="line"><a name="l00679"></a><span class="lineno">  679</span>&#160;</div><div class="line"><a name="l00680"></a><span class="lineno">  680</span>&#160;</div><div class="line"><a name="l00681"></a><span class="lineno">  681</span>&#160;<span class="comment">// Below are utility functions for dealing with various bits for data conversion and wrangling</span></div><div class="line"><a name="l00682"></a><span class="lineno">  682</span>&#160;</div><div class="line"><a name="l00697"></a><span class="lineno">  697</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#gad93de2bdacdcfe04abb0e991a8401388">atcacert_get_key_id</a>(<span class="keyword">const</span> uint8_t public_key[64], uint8_t key_id[20]);</div><div class="line"><a name="l00698"></a><span class="lineno">  698</span>&#160;</div><div class="line"><a name="l00721"></a><span class="lineno">  721</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#ga593780a1837f517ce75bb19d9c5c9db7">atcacert_merge_device_loc</a>(<a class="code" href="a03591.html">atcacert_device_loc_t</a>*       device_locs,</div><div class="line"><a name="l00722"></a><span class="lineno">  722</span>&#160;                              <span class="keywordtype">size_t</span>*                      device_locs_count,</div><div class="line"><a name="l00723"></a><span class="lineno">  723</span>&#160;                              <span class="keywordtype">size_t</span>                       device_locs_max_count,</div><div class="line"><a name="l00724"></a><span class="lineno">  724</span>&#160;                              <span class="keyword">const</span> <a class="code" href="a03591.html">atcacert_device_loc_t</a>* device_loc,</div><div class="line"><a name="l00725"></a><span class="lineno">  725</span>&#160;                              <span class="keywordtype">size_t</span>                       block_size);</div><div class="line"><a name="l00726"></a><span class="lineno">  726</span>&#160;</div><div class="line"><a name="l00727"></a><span class="lineno">  727</span>&#160;<span class="keywordtype">int</span> <a class="code" href="a03534.html#gad2e2ceb6fb7614254a94e89ba244fee7">atcacert_is_device_loc_overlap</a>(<span class="keyword">const</span> <a class="code" href="a03591.html">atcacert_device_loc_t</a>* device_loc1,</div><div class="line"><a name="l00728"></a><span class="lineno">  728</span>&#160;                                   <span class="keyword">const</span> <a class="code" href="a03591.html">atcacert_device_loc_t</a>* device_loc2);</div><div class="line"><a name="l00729"></a><span class="lineno">  729</span>&#160;</div><div class="line"><a name="l00741"></a><span class="lineno">  741</span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03534.html#ga7337facc592df42d585b22345e333ae3">atcacert_public_key_add_padding</a>(<span class="keyword">const</span> uint8_t raw_key[64], uint8_t padded_key[72]);</div><div class="line"><a name="l00742"></a><span class="lineno">  742</span>&#160;</div><div class="line"><a name="l00753"></a><span class="lineno">  753</span>&#160;<span class="keywordtype">void</span> <a class="code" href="a03534.html#gadb83dfb792f1e6e90ce6a3d39f64e129">atcacert_public_key_remove_padding</a>(<span class="keyword">const</span> uint8_t padded_key[72], uint8_t raw_key[64]);</div><div class="line"><a name="l00754"></a><span class="lineno">  754</span>&#160;</div><div class="line"><a name="l00756"></a><span class="lineno">  756</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00757"></a><span class="lineno">  757</span>&#160;}</div><div class="line"><a name="l00758"></a><span class="lineno">  758</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00759"></a><span class="lineno">  759</span>&#160;</div><div class="line"><a name="l00760"></a><span class="lineno">  760</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00761"></a><span class="lineno">  761</span>&#160;</div><div class="ttc" id="a03534_html_ga9e594a491dccf61a638be46da5d40ff9"><div class="ttname"><a href="a03534.html#ga9e594a491dccf61a638be46da5d40ff9">atcacert_cert_build_finish</a></div><div class="ttdeci">int atcacert_cert_build_finish(atcacert_build_state_t *build_state)</div><div class="ttdoc">Completes any final certificate processing required after all data from the device has been incorpora...</div><div class="ttdef"><b>Definition:</b> atcacert_def.c:464</div></div>
<div class="ttc" id="a03534_html_gga813047a656af7fe578d28fd54c840e8ea83bf725c47007c842da4a8e93b1bf972"><div class="ttname"><a href="a03534.html#gga813047a656af7fe578d28fd54c840e8ea83bf725c47007c842da4a8e93b1bf972">SNSRC_PUB_KEY_HASH_RAW</a></div><div class="ttdoc">Depreciated, don&amp;#39;t use. Cert serial number is the SHA256(Subject public key + Encoded dates)...</div><div class="ttdef"><b>Definition:</b> atcacert_def.h:77</div></div>
<div class="ttc" id="a03603_html_a7dcbb1ab3db4003c7f2414e262853e6d"><div class="ttname"><a href="a03603.html#a7dcbb1ab3db4003c7f2414e262853e6d">atcacert_def_s::expire_years</a></div><div class="ttdeci">uint8_t expire_years</div><div class="ttdoc">Number of years the certificate is valid for (5-bit value). 0 means no expiration. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:160</div></div>
<div class="ttc" id="a03603_html_a641e13598992fc536e70b55cc8ee2ea5"><div class="ttname"><a href="a03603.html#a641e13598992fc536e70b55cc8ee2ea5">atcacert_def_s::private_key_slot</a></div><div class="ttdeci">uint8_t private_key_slot</div><div class="ttdoc">If this is a device certificate template, this is the device slot for the device private key...</div><div class="ttdef"><b>Definition:</b> atcacert_def.h:154</div></div>
<div class="ttc" id="a03607_html"><div class="ttname"><a href="a03607.html">atcacert_build_state_s</a></div><div class="ttdef"><b>Definition:</b> atcacert_def.h:174</div></div>
<div class="ttc" id="a03534_html_gaf1f3cdf5e1e65c9abcbe98ae046d9bf2"><div class="ttname"><a href="a03534.html#gaf1f3cdf5e1e65c9abcbe98ae046d9bf2">atcacert_set_signature</a></div><div class="ttdeci">int atcacert_set_signature(const atcacert_def_t *cert_def, uint8_t *cert, size_t *cert_size, size_t max_cert_size, const uint8_t signature[64])</div><div class="ttdoc">Sets the signature in a certificate. This may alter the size of the X.509 certificates. </div><div class="ttdef"><b>Definition:</b> atcacert_def.c:672</div></div>
<div class="ttc" id="a03534_html_ga8fcfb1307197295422ace828b40ee37d"><div class="ttname"><a href="a03534.html#ga8fcfb1307197295422ace828b40ee37d">atcacert_cert_type_t</a></div><div class="ttdeci">enum atcacert_cert_type_e atcacert_cert_type_t</div></div>
<div class="ttc" id="a03534_html_gaa557358df9a164d6c1f14b1f53662c6c"><div class="ttname"><a href="a03534.html#gaa557358df9a164d6c1f14b1f53662c6c">atcacert_cert_sn_src_t</a></div><div class="ttdeci">enum atcacert_cert_sn_src_e atcacert_cert_sn_src_t</div></div>
<div class="ttc" id="a03534_html_gga77184d0c71198b489ea9b57d07da824ea886b91f34d6839fe9e9217490530c604"><div class="ttname"><a href="a03534.html#gga77184d0c71198b489ea9b57d07da824ea886b91f34d6839fe9e9217490530c604">STDCERT_EXPIRE_DATE</a></div><div class="ttdef"><b>Definition:</b> atcacert_def.h:100</div></div>
<div class="ttc" id="a03534_html_gga813047a656af7fe578d28fd54c840e8eabda5814e7da6c10dc243749dea79ffff"><div class="ttname"><a href="a03534.html#gga813047a656af7fe578d28fd54c840e8eabda5814e7da6c10dc243749dea79ffff">SNSRC_SIGNER_ID</a></div><div class="ttdoc">Cert serial number is 0x40(MSB) + 2-byte signer ID. Only applies to signer certificates. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:72</div></div>
<div class="ttc" id="a03607_html_aa09eb68c2656a44748cad406cf960f7c"><div class="ttname"><a href="a03607.html#aa09eb68c2656a44748cad406cf960f7c">atcacert_build_state_s::cert</a></div><div class="ttdeci">uint8_t * cert</div><div class="ttdoc">Buffer to contain the rebuilt certificate. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:177</div></div>
<div class="ttc" id="a03534_html_ga4c4d5fe988ebface171689f3aa122e12"><div class="ttname"><a href="a03534.html#ga4c4d5fe988ebface171689f3aa122e12">atcacert_set_subj_public_key</a></div><div class="ttdeci">int atcacert_set_subj_public_key(const atcacert_def_t *cert_def, uint8_t *cert, size_t cert_size, const uint8_t subj_public_key[64])</div><div class="ttdoc">Sets the subject public key and subject key ID in a certificate. </div><div class="ttdef"><b>Definition:</b> atcacert_def.c:612</div></div>
<div class="ttc" id="a03534_html_gga5430f01929cd7269e04db08d1f28642fa92c401741edaf606af7056851db7dddb"><div class="ttname"><a href="a03534.html#gga5430f01929cd7269e04db08d1f28642fa92c401741edaf606af7056851db7dddb">CERTTYPE_CUSTOM</a></div><div class="ttdoc">Custom format. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:61</div></div>
<div class="ttc" id="a03534_html_ga92ccf01a2c37be9caa7d840846672c83"><div class="ttname"><a href="a03534.html#ga92ccf01a2c37be9caa7d840846672c83">atcacert_build_state_t</a></div><div class="ttdeci">struct atcacert_build_state_s atcacert_build_state_t</div></div>
<div class="ttc" id="a03534_html_gga77184d0c71198b489ea9b57d07da824eaf78a51bddeca05e1a525f26792b6de68"><div class="ttname"><a href="a03534.html#gga77184d0c71198b489ea9b57d07da824eaf78a51bddeca05e1a525f26792b6de68">STDCERT_PUBLIC_KEY</a></div><div class="ttdef"><b>Definition:</b> atcacert_def.h:97</div></div>
<div class="ttc" id="a03607_html_a3969ddf030fd0524b62c572070bb3edc"><div class="ttname"><a href="a03607.html#a3969ddf030fd0524b62c572070bb3edc">atcacert_build_state_s::is_device_sn</a></div><div class="ttdeci">uint8_t is_device_sn</div><div class="ttdoc">Indicates the structure contains the device SN. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:180</div></div>
<div class="ttc" id="a03603_html_a67c40218f646b70740c0d2027eb152a0"><div class="ttname"><a href="a03603.html#a67c40218f646b70740c0d2027eb152a0">atcacert_def_s::cert_template_size</a></div><div class="ttdeci">uint16_t cert_template_size</div><div class="ttdoc">Size of the certificate template in cert_template in bytes. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:167</div></div>
<div class="ttc" id="a03534_html_ga82ca7cff42ee4496a40076faac7ff6f6"><div class="ttname"><a href="a03534.html#ga82ca7cff42ee4496a40076faac7ff6f6">atcacert_set_signer_id</a></div><div class="ttdeci">int atcacert_set_signer_id(const atcacert_def_t *cert_def, uint8_t *cert, size_t cert_size, const uint8_t signer_id[2])</div><div class="ttdoc">Sets the signer ID in a certificate. Will be formatted as 4 upper-case hex digits. </div><div class="ttdef"><b>Definition:</b> atcacert_def.c:945</div></div>
<div class="ttc" id="a03591_html"><div class="ttname"><a href="a03591.html">atcacert_device_loc_s</a></div><div class="ttdef"><b>Definition:</b> atcacert_def.h:115</div></div>
<div class="ttc" id="a03534_html_ga2843ebd40b7f0b6b4bf22cd447fa90e0"><div class="ttname"><a href="a03534.html#ga2843ebd40b7f0b6b4bf22cd447fa90e0">atcacert_get_subj_key_id</a></div><div class="ttdeci">int atcacert_get_subj_key_id(const atcacert_def_t *cert_def, const uint8_t *cert, size_t cert_size, uint8_t subj_key_id[20])</div><div class="ttdoc">Gets the subject key ID from a certificate. </div><div class="ttdef"><b>Definition:</b> atcacert_def.c:659</div></div>
<div class="ttc" id="a03534_html_gae1f109cb8edea615c0f7126527208452"><div class="ttname"><a href="a03534.html#gae1f109cb8edea615c0f7126527208452">atcacert_gen_cert_sn</a></div><div class="ttdeci">int atcacert_gen_cert_sn(const atcacert_def_t *cert_def, uint8_t *cert, size_t cert_size, const uint8_t device_sn[9])</div><div class="ttdoc">Sets the certificate serial number by generating it from other information in the certificate using t...</div><div class="ttdef"><b>Definition:</b> atcacert_def.c:1118</div></div>
<div class="ttc" id="a03534_html_gadb83dfb792f1e6e90ce6a3d39f64e129"><div class="ttname"><a href="a03534.html#gadb83dfb792f1e6e90ce6a3d39f64e129">atcacert_public_key_remove_padding</a></div><div class="ttdeci">void atcacert_public_key_remove_padding(const uint8_t padded_key[72], uint8_t raw_key[64])</div><div class="ttdoc">Takes a padded public key used by ATECC devices and converts it to a raw P256 ECC public key...</div><div class="ttdef"><b>Definition:</b> atcacert_def.c:1630</div></div>
<div class="ttc" id="a03603_html_acb91631744ba06809269dc2f137c835c"><div class="ttname"><a href="a03603.html#acb91631744ba06809269dc2f137c835c">atcacert_def_s::cert_template</a></div><div class="ttdeci">const uint8_t * cert_template</div><div class="ttdoc">Pointer to the actual certificate template data. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:166</div></div>
<div class="ttc" id="a03534_html_gga813047a656af7fe578d28fd54c840e8ea4c213faf0171fcc6aeb27a1ca344342b"><div class="ttname"><a href="a03534.html#gga813047a656af7fe578d28fd54c840e8ea4c213faf0171fcc6aeb27a1ca344342b">SNSRC_STORED_DYNAMIC</a></div><div class="ttdoc">Cert serial is stored on the device with the first byte being the DER size (X509 certs only)...</div><div class="ttdef"><b>Definition:</b> atcacert_def.h:70</div></div>
<div class="ttc" id="a03534_html_gga813047a656af7fe578d28fd54c840e8eab87e9124d93ca45243eacac5b96452b7"><div class="ttname"><a href="a03534.html#gga813047a656af7fe578d28fd54c840e8eab87e9124d93ca45243eacac5b96452b7">SNSRC_DEVICE_SN_HASH_POS</a></div><div class="ttdoc">Depreciated, don&amp;#39;t use. Cert serial number is the SHA256(Device SN + Encoded dates), with MSBit set to 0 to ensure it&amp;#39;s positive. Only applies to device certificates. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:76</div></div>
<div class="ttc" id="a03607_html_a5aa8a40126b53aa3748ba0d00de61e60"><div class="ttname"><a href="a03607.html#a5aa8a40126b53aa3748ba0d00de61e60">atcacert_build_state_s::device_sn</a></div><div class="ttdeci">uint8_t device_sn[9]</div><div class="ttdoc">Storage for the device SN, when it&amp;#39;s found. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:181</div></div>
<div class="ttc" id="a03603_html"><div class="ttname"><a href="a03603.html">atcacert_def_s</a></div><div class="ttdef"><b>Definition:</b> atcacert_def.h:149</div></div>
<div class="ttc" id="a03534_html_gga1c0876228cb459f64347a63f3bae4c73ae42ffc066a13ac1f38195d2cf4e60cea"><div class="ttname"><a href="a03534.html#gga1c0876228cb459f64347a63f3bae4c73ae42ffc066a13ac1f38195d2cf4e60cea">DEVZONE_OTP</a></div><div class="ttdoc">One Time Programmable zone. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:87</div></div>
<div class="ttc" id="a03534_html_gaf64c228c28f42f15e9b43457146d1504"><div class="ttname"><a href="a03534.html#gaf64c228c28f42f15e9b43457146d1504">atcacert_get_cert_sn</a></div><div class="ttdeci">int atcacert_get_cert_sn(const atcacert_def_t *cert_def, const uint8_t *cert, size_t cert_size, uint8_t *cert_sn, size_t *cert_sn_size)</div><div class="ttdoc">Gets the certificate serial number from a certificate. </div><div class="ttdef"><b>Definition:</b> atcacert_def.c:1254</div></div>
<div class="ttc" id="a03534_html_gae9e78b17340263e97844ccaf72ca16ac"><div class="ttname"><a href="a03534.html#gae9e78b17340263e97844ccaf72ca16ac">atcacert_def_t</a></div><div class="ttdeci">struct atcacert_def_s atcacert_def_t</div></div>
<div class="ttc" id="a03534_html_ga1c0876228cb459f64347a63f3bae4c73"><div class="ttname"><a href="a03534.html#ga1c0876228cb459f64347a63f3bae4c73">atcacert_device_zone_e</a></div><div class="ttdeci">atcacert_device_zone_e</div><div class="ttdef"><b>Definition:</b> atcacert_def.h:84</div></div>
<div class="ttc" id="a03534_html_gga77184d0c71198b489ea9b57d07da824ea97400647cc539ce999c0b9f95d736585"><div class="ttname"><a href="a03534.html#gga77184d0c71198b489ea9b57d07da824ea97400647cc539ce999c0b9f95d736585">STDCERT_SUBJ_KEY_ID</a></div><div class="ttdef"><b>Definition:</b> atcacert_def.h:104</div></div>
<div class="ttc" id="a03603_html_aa9a44f95411d86a78a93e650a9c19f53"><div class="ttname"><a href="a03603.html#aa9a44f95411d86a78a93e650a9c19f53">atcacert_def_s::cert_elements</a></div><div class="ttdeci">const atcacert_cert_element_t * cert_elements</div><div class="ttdoc">Additional certificate elements outside of the standard certificate contents. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:164</div></div>
<div class="ttc" id="a03534_html_gga1c0876228cb459f64347a63f3bae4c73a774ecb8e950d309498a9aa64933d95cb"><div class="ttname"><a href="a03534.html#gga1c0876228cb459f64347a63f3bae4c73a774ecb8e950d309498a9aa64933d95cb">DEVZONE_DATA</a></div><div class="ttdoc">Data zone (slots). </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:88</div></div>
<div class="ttc" id="a03534_html_gga77184d0c71198b489ea9b57d07da824ea8eab5679d330212bb87b2413ea82b7cc"><div class="ttname"><a href="a03534.html#gga77184d0c71198b489ea9b57d07da824ea8eab5679d330212bb87b2413ea82b7cc">STDCERT_SIGNATURE</a></div><div class="ttdef"><b>Definition:</b> atcacert_def.h:98</div></div>
<div class="ttc" id="a03603_html_aa5cb3f21e0d4d77567550388a7f08768"><div class="ttname"><a href="a03603.html#aa5cb3f21e0d4d77567550388a7f08768">atcacert_def_s::ca_cert_def</a></div><div class="ttdeci">const struct atcacert_def_s * ca_cert_def</div><div class="ttdoc">Certificate definition of the CA certificate. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:168</div></div>
<div class="ttc" id="a03534_html_ga0fb6e40d2f1496215af2f9ae23c861a0"><div class="ttname"><a href="a03534.html#ga0fb6e40d2f1496215af2f9ae23c861a0">atcacert_device_loc_t</a></div><div class="ttdeci">struct atcacert_device_loc_s atcacert_device_loc_t</div></div>
<div class="ttc" id="a03534_html_gad93de2bdacdcfe04abb0e991a8401388"><div class="ttname"><a href="a03534.html#gad93de2bdacdcfe04abb0e991a8401388">atcacert_get_key_id</a></div><div class="ttdeci">int atcacert_get_key_id(const uint8_t public_key[64], uint8_t key_id[20])</div><div class="ttdoc">Calculates the key ID for a given public ECC P256 key. </div><div class="ttdef"><b>Definition:</b> atcacert_def.c:1607</div></div>
<div class="ttc" id="a03534_html_gacdb102fcae9f3a822a19b2ca487b415d"><div class="ttname"><a href="a03534.html#gacdb102fcae9f3a822a19b2ca487b415d">atcacert_get_cert_element</a></div><div class="ttdeci">int atcacert_get_cert_element(const atcacert_def_t *cert_def, const atcacert_cert_loc_t *cert_loc, const uint8_t *cert, size_t cert_size, uint8_t *data, size_t data_size)</div><div class="ttdoc">Gets an element from a certificate. </div><div class="ttdef"><b>Definition:</b> atcacert_def.c:1571</div></div>
<div class="ttc" id="a03595_html_af6a39bfc7e1dc3b6f9c997c1c43fa996"><div class="ttname"><a href="a03595.html#af6a39bfc7e1dc3b6f9c997c1c43fa996">atcacert_cert_loc_s::count</a></div><div class="ttdeci">uint16_t count</div><div class="ttdoc">Byte count. Set to 0 if it doesn&amp;#39;t exist. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:130</div></div>
<div class="ttc" id="a00143_html"><div class="ttname"><a href="a00143.html">atcacert_date.h</a></div><div class="ttdoc">Declarations for date handling with regard to certificates. </div></div>
<div class="ttc" id="a03591_html_ad23984515efd99983fa4baf3754082a1"><div class="ttname"><a href="a03591.html#ad23984515efd99983fa4baf3754082a1">atcacert_device_loc_s::slot</a></div><div class="ttdeci">uint8_t slot</div><div class="ttdoc">Slot within the data zone. Only applies if zone is DEVZONE_DATA. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:118</div></div>
<div class="ttc" id="a03534_html_ga7337facc592df42d585b22345e333ae3"><div class="ttname"><a href="a03534.html#ga7337facc592df42d585b22345e333ae3">atcacert_public_key_add_padding</a></div><div class="ttdeci">void atcacert_public_key_add_padding(const uint8_t raw_key[64], uint8_t padded_key[72])</div><div class="ttdoc">Takes a raw P256 ECC public key and converts it to the padded version used by ATECC devices...</div><div class="ttdef"><b>Definition:</b> atcacert_def.c:1622</div></div>
<div class="ttc" id="a03599_html_af74e55b0689356f989d8330ae3072376"><div class="ttname"><a href="a03599.html#af74e55b0689356f989d8330ae3072376">atcacert_cert_element_s::cert_loc</a></div><div class="ttdeci">atcacert_cert_loc_t cert_loc</div><div class="ttdoc">Location in the certificate template for the element. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:140</div></div>
<div class="ttc" id="a03534_html_ga294899ca77a6801288e1ccb148de1f8b"><div class="ttname"><a href="a03534.html#ga294899ca77a6801288e1ccb148de1f8b">atcacert_device_zone_t</a></div><div class="ttdeci">enum atcacert_device_zone_e atcacert_device_zone_t</div></div>
<div class="ttc" id="a03534_html_gaf55b75df5e523e2d275ebb8cbe36fec6"><div class="ttname"><a href="a03534.html#gaf55b75df5e523e2d275ebb8cbe36fec6">atcacert_get_signature</a></div><div class="ttdeci">int atcacert_get_signature(const atcacert_def_t *cert_def, const uint8_t *cert, size_t cert_size, uint8_t signature[64])</div><div class="ttdoc">Gets the signature from a certificate. </div><div class="ttdef"><b>Definition:</b> atcacert_def.c:743</div></div>
<div class="ttc" id="a03534_html_gga77184d0c71198b489ea9b57d07da824ea2f3039692a71546e581fcaf8a8a53f15"><div class="ttname"><a href="a03534.html#gga77184d0c71198b489ea9b57d07da824ea2f3039692a71546e581fcaf8a8a53f15">STDCERT_ISSUE_DATE</a></div><div class="ttdef"><b>Definition:</b> atcacert_def.h:99</div></div>
<div class="ttc" id="a03607_html_a083f29531821a0ef698b452cb2b7f5b4"><div class="ttname"><a href="a03607.html#a083f29531821a0ef698b452cb2b7f5b4">atcacert_build_state_s::cert_size</a></div><div class="ttdeci">size_t * cert_size</div><div class="ttdoc">Current size of the certificate in bytes. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:178</div></div>
<div class="ttc" id="a03534_html_gga813047a656af7fe578d28fd54c840e8eacaf00502661bc7b9c260ca68831928b5"><div class="ttname"><a href="a03534.html#gga813047a656af7fe578d28fd54c840e8eacaf00502661bc7b9c260ca68831928b5">SNSRC_PUB_KEY_HASH_POS</a></div><div class="ttdoc">Depreciated, don&amp;#39;t use. Cert serial number is the SHA256(Subject public key + Encoded dates)...</div><div class="ttdef"><b>Definition:</b> atcacert_def.h:75</div></div>
<div class="ttc" id="a03603_html_a61f951f9c4366391012057d591888f32"><div class="ttname"><a href="a03603.html#a61f951f9c4366391012057d591888f32">atcacert_def_s::issue_date_format</a></div><div class="ttdeci">atcacert_date_format_t issue_date_format</div><div class="ttdoc">Format of the issue date in the certificate. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:157</div></div>
<div class="ttc" id="a03534_html_ga5430f01929cd7269e04db08d1f28642f"><div class="ttname"><a href="a03534.html#ga5430f01929cd7269e04db08d1f28642f">atcacert_cert_type_e</a></div><div class="ttdeci">atcacert_cert_type_e</div><div class="ttdef"><b>Definition:</b> atcacert_def.h:58</div></div>
<div class="ttc" id="a03534_html_gad2e2ceb6fb7614254a94e89ba244fee7"><div class="ttname"><a href="a03534.html#gad2e2ceb6fb7614254a94e89ba244fee7">atcacert_is_device_loc_overlap</a></div><div class="ttdeci">int atcacert_is_device_loc_overlap(const atcacert_device_loc_t *device_loc1, const atcacert_device_loc_t *device_loc2)</div><div class="ttdef"><b>Definition:</b> atcacert_def.c:488</div></div>
<div class="ttc" id="a03599_html"><div class="ttname"><a href="a03599.html">atcacert_cert_element_s</a></div><div class="ttdef"><b>Definition:</b> atcacert_def.h:136</div></div>
<div class="ttc" id="a03534_html_gga77184d0c71198b489ea9b57d07da824ea73b3d53d4e70a48fd3fdeb0143493efc"><div class="ttname"><a href="a03534.html#gga77184d0c71198b489ea9b57d07da824ea73b3d53d4e70a48fd3fdeb0143493efc">STDCERT_CERT_SN</a></div><div class="ttdef"><b>Definition:</b> atcacert_def.h:102</div></div>
<div class="ttc" id="a03534_html_gad499cd0bdce799a3278f99c80e0f9143"><div class="ttname"><a href="a03534.html#gad499cd0bdce799a3278f99c80e0f9143">atcacert_set_expire_date</a></div><div class="ttdeci">int atcacert_set_expire_date(const atcacert_def_t *cert_def, uint8_t *cert, size_t cert_size, const atcacert_tm_utc_t *timestamp)</div><div class="ttdoc">Sets the expire date (notAfter) in a certificate. Will be formatted according to the date format spec...</div><div class="ttdef"><b>Definition:</b> atcacert_def.c:848</div></div>
<div class="ttc" id="a03534_html_ga2e2c59c41193e71b1a4b96f58642bb49"><div class="ttname"><a href="a03534.html#ga2e2c59c41193e71b1a4b96f58642bb49">atcacert_set_comp_cert</a></div><div class="ttdeci">int atcacert_set_comp_cert(const atcacert_def_t *cert_def, uint8_t *cert, size_t *cert_size, size_t max_cert_size, const uint8_t comp_cert[72])</div><div class="ttdoc">Sets the signature, issue date, expire date, and signer ID found in the compressed certificate...</div><div class="ttdef"><b>Definition:</b> atcacert_def.c:1338</div></div>
<div class="ttc" id="a03534_html_ga51f7b996909bc9cae783bcaf0fe7082b"><div class="ttname"><a href="a03534.html#ga51f7b996909bc9cae783bcaf0fe7082b">atcacert_get_issue_date</a></div><div class="ttdeci">int atcacert_get_issue_date(const atcacert_def_t *cert_def, const uint8_t *cert, size_t cert_size, atcacert_tm_utc_t *timestamp)</div><div class="ttdoc">Gets the issue date from a certificate. Will be parsed according to the date format specified in the ...</div><div class="ttdef"><b>Definition:</b> atcacert_def.c:808</div></div>
<div class="ttc" id="a03534_html_gga813047a656af7fe578d28fd54c840e8ea1b3e4833214ba25ba3d665135b2b6cd1"><div class="ttname"><a href="a03534.html#gga813047a656af7fe578d28fd54c840e8ea1b3e4833214ba25ba3d665135b2b6cd1">SNSRC_STORED</a></div><div class="ttdoc">Cert serial is stored on the device. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:69</div></div>
<div class="ttc" id="a03587_html"><div class="ttname"><a href="a03587.html">atcacert_tm_utc_s</a></div><div class="ttdef"><b>Definition:</b> atcacert_date.h:52</div></div>
<div class="ttc" id="a03534_html_ga36d4893ccd152a8ec18f84f90a5e3cb5"><div class="ttname"><a href="a03534.html#ga36d4893ccd152a8ec18f84f90a5e3cb5">atcacert_set_issue_date</a></div><div class="ttdeci">int atcacert_set_issue_date(const atcacert_def_t *cert_def, uint8_t *cert, size_t cert_size, const atcacert_tm_utc_t *timestamp)</div><div class="ttdoc">Sets the issue date (notBefore) in a certificate. Will be formatted according to the date format spec...</div><div class="ttdef"><b>Definition:</b> atcacert_def.c:774</div></div>
<div class="ttc" id="a03534_html_gga813047a656af7fe578d28fd54c840e8ea338258d51f0eb1c5d7ef9f0e639f5e41"><div class="ttname"><a href="a03534.html#gga813047a656af7fe578d28fd54c840e8ea338258d51f0eb1c5d7ef9f0e639f5e41">SNSRC_DEVICE_SN</a></div><div class="ttdoc">Cert serial number is 0x40(MSB) + 9-byte device serial number. Only applies to device certificates...</div><div class="ttdef"><b>Definition:</b> atcacert_def.h:71</div></div>
<div class="ttc" id="a03534_html_ga7f389df0f74fd3593ab7e3a4d380433f"><div class="ttname"><a href="a03534.html#ga7f389df0f74fd3593ab7e3a4d380433f">atcacert_date_format_t</a></div><div class="ttdeci">enum atcacert_date_format_e atcacert_date_format_t</div></div>
<div class="ttc" id="a03591_html_ac681806181c80437cfab37335f62ff39"><div class="ttname"><a href="a03591.html#ac681806181c80437cfab37335f62ff39">atcacert_device_loc_s::offset</a></div><div class="ttdeci">uint16_t offset</div><div class="ttdoc">Byte offset in the zone. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:120</div></div>
<div class="ttc" id="a03534_html_ga77184d0c71198b489ea9b57d07da824e"><div class="ttname"><a href="a03534.html#ga77184d0c71198b489ea9b57d07da824e">atcacert_std_cert_element_e</a></div><div class="ttdeci">atcacert_std_cert_element_e</div><div class="ttdef"><b>Definition:</b> atcacert_def.h:95</div></div>
<div class="ttc" id="a03534_html_ga1201f3c1a20b5b105f9160bea104b102"><div class="ttname"><a href="a03534.html#ga1201f3c1a20b5b105f9160bea104b102">atcacert_get_signer_id</a></div><div class="ttdeci">int atcacert_get_signer_id(const atcacert_def_t *cert_def, const uint8_t *cert, size_t cert_size, uint8_t signer_id[2])</div><div class="ttdoc">Gets the signer ID from a certificate. Will be parsed as 4 upper-case hex digits. ...</div><div class="ttdef"><b>Definition:</b> atcacert_def.c:1004</div></div>
<div class="ttc" id="a03603_html_a7e2ecd6c0b4cef9637e3b281d29200ce"><div class="ttname"><a href="a03603.html#a7e2ecd6c0b4cef9637e3b281d29200ce">atcacert_def_s::std_cert_elements</a></div><div class="ttdeci">atcacert_cert_loc_t std_cert_elements[STDCERT_NUM_ELEMENTS]</div><div class="ttdoc">Where in the certificate template the standard cert elements are inserted. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:163</div></div>
<div class="ttc" id="a03534_html_gga813047a656af7fe578d28fd54c840e8ea2d608b2eeb6da309c1e9b2af7060d909"><div class="ttname"><a href="a03534.html#gga813047a656af7fe578d28fd54c840e8ea2d608b2eeb6da309c1e9b2af7060d909">SNSRC_DEVICE_SN_HASH_RAW</a></div><div class="ttdoc">Depreciated, don&amp;#39;t use. Cert serial number is the SHA256(Device SN + Encoded dates). Only applies to device certificates. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:78</div></div>
<div class="ttc" id="a03534_html_ga626158cfe54b84903885b2cc6c3880e4"><div class="ttname"><a href="a03534.html#ga626158cfe54b84903885b2cc6c3880e4">atcacert_cert_build_process</a></div><div class="ttdeci">int atcacert_cert_build_process(atcacert_build_state_t *build_state, const atcacert_device_loc_t *device_loc, const uint8_t *device_data)</div><div class="ttdoc">Process information read from the ATECC device. If it contains information for the certificate...</div><div class="ttdef"><b>Definition:</b> atcacert_def.c:336</div></div>
<div class="ttc" id="a03599_html_aa36729eb861afe13bb70974147bc403b"><div class="ttname"><a href="a03599.html#aa36729eb861afe13bb70974147bc403b">atcacert_cert_element_s::device_loc</a></div><div class="ttdeci">atcacert_device_loc_t device_loc</div><div class="ttdoc">Location in the device for the element. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:139</div></div>
<div class="ttc" id="a03534_html_ga8d14206d455a7a7835ed613e57c20dd3"><div class="ttname"><a href="a03534.html#ga8d14206d455a7a7835ed613e57c20dd3">atcacert_cert_element_t</a></div><div class="ttdeci">struct atcacert_cert_element_s atcacert_cert_element_t</div></div>
<div class="ttc" id="a03534_html_ga84f1aeed7b88889d5bf01f21dbaaf398"><div class="ttname"><a href="a03534.html#ga84f1aeed7b88889d5bf01f21dbaaf398">atcacert_get_device_locs</a></div><div class="ttdeci">int atcacert_get_device_locs(const atcacert_def_t *cert_def, atcacert_device_loc_t *device_locs, size_t *device_locs_count, size_t device_locs_max_count, size_t block_size)</div><div class="ttdoc">Add all the device locations required to rebuild the specified certificate (cert_def) to a device loc...</div><div class="ttdef"><b>Definition:</b> atcacert_def.c:119</div></div>
<div class="ttc" id="a03534_html_gga1c0876228cb459f64347a63f3bae4c73a4856bc2fcbda0be68832968204126207"><div class="ttname"><a href="a03534.html#gga1c0876228cb459f64347a63f3bae4c73a4856bc2fcbda0be68832968204126207">DEVZONE_CONFIG</a></div><div class="ttdoc">Configuration zone. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:86</div></div>
<div class="ttc" id="a03603_html_a44b6808e0d081cb5fd82f58f7de32e4a"><div class="ttname"><a href="a03603.html#a44b6808e0d081cb5fd82f58f7de32e4a">atcacert_def_s::template_id</a></div><div class="ttdeci">uint8_t template_id</div><div class="ttdoc">ID for the this certificate definition (4-bit value). </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:152</div></div>
<div class="ttc" id="a03595_html"><div class="ttname"><a href="a03595.html">atcacert_cert_loc_s</a></div><div class="ttdef"><b>Definition:</b> atcacert_def.h:127</div></div>
<div class="ttc" id="a03534_html_ga9a7903692035d06b5d1a45c3b56fce3a"><div class="ttname"><a href="a03534.html#ga9a7903692035d06b5d1a45c3b56fce3a">atcacert_get_comp_cert</a></div><div class="ttdeci">int atcacert_get_comp_cert(const atcacert_def_t *cert_def, const uint8_t *cert, size_t cert_size, uint8_t comp_cert[72])</div><div class="ttdoc">Generate the compressed certificate for the given certificate. </div><div class="ttdef"><b>Definition:</b> atcacert_def.c:1414</div></div>
<div class="ttc" id="a03607_html_abaf4bb65d962f53a31b943c663eaf3b9"><div class="ttname"><a href="a03607.html#abaf4bb65d962f53a31b943c663eaf3b9">atcacert_build_state_s::cert_def</a></div><div class="ttdeci">const atcacert_def_t * cert_def</div><div class="ttdoc">Certificate definition for the certificate being rebuilt. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:176</div></div>
<div class="ttc" id="a03534_html_gga1c0876228cb459f64347a63f3bae4c73afe6b6aedf2a765638f3c62817db11f05"><div class="ttname"><a href="a03534.html#gga1c0876228cb459f64347a63f3bae4c73afe6b6aedf2a765638f3c62817db11f05">DEVZONE_NONE</a></div><div class="ttdoc">Special value used to indicate there is no device location. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:89</div></div>
<div class="ttc" id="a03534_html_gga5430f01929cd7269e04db08d1f28642fa82bc16ac5283813ee3ffe7cddf8e2b44"><div class="ttname"><a href="a03534.html#gga5430f01929cd7269e04db08d1f28642fa82bc16ac5283813ee3ffe7cddf8e2b44">CERTTYPE_X509</a></div><div class="ttdoc">Standard X509 certificate. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:60</div></div>
<div class="ttc" id="a03603_html_ad158ea4479470d5470412d504428459b"><div class="ttname"><a href="a03603.html#ad158ea4479470d5470412d504428459b">atcacert_def_s::type</a></div><div class="ttdeci">atcacert_cert_type_t type</div><div class="ttdoc">Certificate type. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:151</div></div>
<div class="ttc" id="a03534_html_ga94a3b57e412fe2cfddf92fdc8e54a41e"><div class="ttname"><a href="a03534.html#ga94a3b57e412fe2cfddf92fdc8e54a41e">atcacert_set_auth_key_id_raw</a></div><div class="ttdeci">int atcacert_set_auth_key_id_raw(const atcacert_def_t *cert_def, uint8_t *cert, size_t cert_size, const uint8_t *auth_key_id)</div><div class="ttdoc">Sets the authority key ID in a certificate. </div><div class="ttdef"><b>Definition:</b> atcacert_def.c:1304</div></div>
<div class="ttc" id="a03534_html_ga0b2fd4ca54a1fde2d0d669b1fc11284a"><div class="ttname"><a href="a03534.html#ga0b2fd4ca54a1fde2d0d669b1fc11284a">atcacert_get_tbs_digest</a></div><div class="ttdeci">int atcacert_get_tbs_digest(const atcacert_def_t *cert_def, const uint8_t *cert, size_t cert_size, uint8_t tbs_digest[32])</div><div class="ttdoc">Get the SHA256 digest of certificate&amp;#39;s TBS data. </div><div class="ttdef"><b>Definition:</b> atcacert_def.c:1497</div></div>
<div class="ttc" id="a03534_html_ga8d1d761d35cf36feea5c626bb1d70ab2"><div class="ttname"><a href="a03534.html#ga8d1d761d35cf36feea5c626bb1d70ab2">atcacert_get_expire_date</a></div><div class="ttdeci">int atcacert_get_expire_date(const atcacert_def_t *cert_def, const uint8_t *cert, size_t cert_size, atcacert_tm_utc_t *timestamp)</div><div class="ttdoc">Gets the expire date from a certificate. Will be parsed according to the date format specified in the...</div><div class="ttdef"><b>Definition:</b> atcacert_def.c:882</div></div>
<div class="ttc" id="a03534_html_ga593780a1837f517ce75bb19d9c5c9db7"><div class="ttname"><a href="a03534.html#ga593780a1837f517ce75bb19d9c5c9db7">atcacert_merge_device_loc</a></div><div class="ttdeci">int atcacert_merge_device_loc(atcacert_device_loc_t *device_locs, size_t *device_locs_count, size_t device_locs_max_count, const atcacert_device_loc_t *device_loc, size_t block_size)</div><div class="ttdoc">Merge a new device location into a list of device locations. If the new location overlaps with an exi...</div><div class="ttdef"><b>Definition:</b> atcacert_def.c:38</div></div>
<div class="ttc" id="a03534_html_ga9883eaf43aa94e7a29c1bdf13514185c"><div class="ttname"><a href="a03534.html#ga9883eaf43aa94e7a29c1bdf13514185c">atcacert_get_tbs</a></div><div class="ttdeci">int atcacert_get_tbs(const atcacert_def_t *cert_def, const uint8_t *cert, size_t cert_size, const uint8_t **tbs, size_t *tbs_size)</div><div class="ttdoc">Get a pointer to the TBS data in a certificate. </div><div class="ttdef"><b>Definition:</b> atcacert_def.c:1471</div></div>
<div class="ttc" id="a03591_html_af6a39bfc7e1dc3b6f9c997c1c43fa996"><div class="ttname"><a href="a03591.html#af6a39bfc7e1dc3b6f9c997c1c43fa996">atcacert_device_loc_s::count</a></div><div class="ttdeci">uint16_t count</div><div class="ttdoc">Byte count. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:121</div></div>
<div class="ttc" id="a03534_html_gae7c32139e6dce0fe25b4598299a77df6"><div class="ttname"><a href="a03534.html#gae7c32139e6dce0fe25b4598299a77df6">atcacert_cert_loc_t</a></div><div class="ttdeci">struct atcacert_cert_loc_s atcacert_cert_loc_t</div></div>
<div class="ttc" id="a03534_html_ga5dacb3927ef7eacfaf8c4e28641f7bce"><div class="ttname"><a href="a03534.html#ga5dacb3927ef7eacfaf8c4e28641f7bce">atcacert_set_cert_element</a></div><div class="ttdeci">int atcacert_set_cert_element(const atcacert_def_t *cert_def, const atcacert_cert_loc_t *cert_loc, uint8_t *cert, size_t cert_size, const uint8_t *data, size_t data_size)</div><div class="ttdoc">Sets an element in a certificate. The data_size must match the size in cert_loc. </div><div class="ttdef"><b>Definition:</b> atcacert_def.c:1526</div></div>
<div class="ttc" id="a03534_html_ga813047a656af7fe578d28fd54c840e8e"><div class="ttname"><a href="a03534.html#ga813047a656af7fe578d28fd54c840e8e">atcacert_cert_sn_src_e</a></div><div class="ttdeci">atcacert_cert_sn_src_e</div><div class="ttdef"><b>Definition:</b> atcacert_def.h:67</div></div>
<div class="ttc" id="a03534_html_ga0a5a5fb234b9aa7093ae3a0bb2785f73"><div class="ttname"><a href="a03534.html#ga0a5a5fb234b9aa7093ae3a0bb2785f73">atcacert_set_cert_sn</a></div><div class="ttdeci">int atcacert_set_cert_sn(const atcacert_def_t *cert_def, uint8_t *cert, size_t *cert_size, size_t max_cert_size, const uint8_t *cert_sn, size_t cert_sn_size)</div><div class="ttdoc">Sets the certificate serial number in a certificate. </div><div class="ttdef"><b>Definition:</b> atcacert_def.c:1038</div></div>
<div class="ttc" id="a03591_html_a107ad412023faa68c4ac0c7cfd921a02"><div class="ttname"><a href="a03591.html#a107ad412023faa68c4ac0c7cfd921a02">atcacert_device_loc_s::zone</a></div><div class="ttdeci">atcacert_device_zone_t zone</div><div class="ttdoc">Zone in the device. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:117</div></div>
<div class="ttc" id="a03603_html_a6367c516be990bdce86047b5d9acda14"><div class="ttname"><a href="a03603.html#a6367c516be990bdce86047b5d9acda14">atcacert_def_s::expire_date_format</a></div><div class="ttdeci">atcacert_date_format_t expire_date_format</div><div class="ttdoc">format of the expire date in the certificate. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:158</div></div>
<div class="ttc" id="a03591_html_ab0cedc80cd8670d02eee4b6e31500f5f"><div class="ttname"><a href="a03591.html#ab0cedc80cd8670d02eee4b6e31500f5f">atcacert_device_loc_s::is_genkey</a></div><div class="ttdeci">uint8_t is_genkey</div><div class="ttdoc">If true, use GenKey command to get the contents instead of Read. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:119</div></div>
<div class="ttc" id="a03534_html_gga813047a656af7fe578d28fd54c840e8ea5dadea2da6020b492727eb1da6c4bb1e"><div class="ttname"><a href="a03534.html#gga813047a656af7fe578d28fd54c840e8ea5dadea2da6020b492727eb1da6c4bb1e">SNSRC_PUB_KEY_HASH</a></div><div class="ttdoc">Cert serial number is the SHA256(Subject public key + Encoded dates), with uppermost 2 bits set to 01...</div><div class="ttdef"><b>Definition:</b> atcacert_def.h:73</div></div>
<div class="ttc" id="a03534_html_ga7b22f63ccda2cba10d5ca3dd9c39a06c"><div class="ttname"><a href="a03534.html#ga7b22f63ccda2cba10d5ca3dd9c39a06c">atcacert_set_auth_key_id</a></div><div class="ttdeci">int atcacert_set_auth_key_id(const atcacert_def_t *cert_def, uint8_t *cert, size_t cert_size, const uint8_t auth_public_key[64])</div><div class="ttdoc">Sets the authority key ID in a certificate. Note that this takes the actual public key creates a key ...</div><div class="ttdef"><b>Definition:</b> atcacert_def.c:1276</div></div>
<div class="ttc" id="a03603_html_af44c31e823af19e6efe6b418a13fafe3"><div class="ttname"><a href="a03603.html#af44c31e823af19e6efe6b418a13fafe3">atcacert_def_s::sn_source</a></div><div class="ttdeci">atcacert_cert_sn_src_t sn_source</div><div class="ttdoc">Where the certificate serial number comes from (4-bit value). </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:155</div></div>
<div class="ttc" id="a03603_html_af383252a42d77882d0f3aac7f6ee5048"><div class="ttname"><a href="a03603.html#af383252a42d77882d0f3aac7f6ee5048">atcacert_def_s::chain_id</a></div><div class="ttdeci">uint8_t chain_id</div><div class="ttdoc">ID for the certificate chain this definition is a part of (4-bit value). </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:153</div></div>
<div class="ttc" id="a03534_html_gga77184d0c71198b489ea9b57d07da824ead9a44768825ebcc67750d8e4172dc60f"><div class="ttname"><a href="a03534.html#gga77184d0c71198b489ea9b57d07da824ead9a44768825ebcc67750d8e4172dc60f">STDCERT_NUM_ELEMENTS</a></div><div class="ttdoc">Special item to give the number of elements in this enum. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:105</div></div>
<div class="ttc" id="a00131_html"><div class="ttname"><a href="a00131.html">atcacert.h</a></div><div class="ttdoc">Declarations common to all atcacert code. </div></div>
<div class="ttc" id="a03603_html_a3a8aede64cc4e17e9495ada7a64ab24f"><div class="ttname"><a href="a03603.html#a3a8aede64cc4e17e9495ada7a64ab24f">atcacert_def_s::tbs_cert_loc</a></div><div class="ttdeci">atcacert_cert_loc_t tbs_cert_loc</div><div class="ttdoc">Location in the certificate for the TBS (to be signed) portion. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:159</div></div>
<div class="ttc" id="a03534_html_gga77184d0c71198b489ea9b57d07da824eadfaaad6a933423f63fc3233bd84b90d3"><div class="ttname"><a href="a03534.html#gga77184d0c71198b489ea9b57d07da824eadfaaad6a933423f63fc3233bd84b90d3">STDCERT_SIGNER_ID</a></div><div class="ttdef"><b>Definition:</b> atcacert_def.h:101</div></div>
<div class="ttc" id="a03603_html_afe2b347e101c9f7be9f73b8fda53de29"><div class="ttname"><a href="a03603.html#afe2b347e101c9f7be9f73b8fda53de29">atcacert_def_s::cert_elements_count</a></div><div class="ttdeci">uint8_t cert_elements_count</div><div class="ttdoc">Number of additional certificate elements in cert_elements. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:165</div></div>
<div class="ttc" id="a03534_html_gga77184d0c71198b489ea9b57d07da824ea6a9cddad9f6b552f0fe5f63fc57cf106"><div class="ttname"><a href="a03534.html#gga77184d0c71198b489ea9b57d07da824ea6a9cddad9f6b552f0fe5f63fc57cf106">STDCERT_AUTH_KEY_ID</a></div><div class="ttdef"><b>Definition:</b> atcacert_def.h:103</div></div>
<div class="ttc" id="a03595_html_ac681806181c80437cfab37335f62ff39"><div class="ttname"><a href="a03595.html#ac681806181c80437cfab37335f62ff39">atcacert_cert_loc_s::offset</a></div><div class="ttdeci">uint16_t offset</div><div class="ttdoc">Byte offset in the certificate template. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:129</div></div>
<div class="ttc" id="a03534_html_gadf6c26dd4333931acf2b8f6ac9a5f422"><div class="ttname"><a href="a03534.html#gadf6c26dd4333931acf2b8f6ac9a5f422">atcacert_get_auth_key_id</a></div><div class="ttdeci">int atcacert_get_auth_key_id(const atcacert_def_t *cert_def, const uint8_t *cert, size_t cert_size, uint8_t auth_key_id[20])</div><div class="ttdoc">Gets the authority key ID from a certificate. </div><div class="ttdef"><b>Definition:</b> atcacert_def.c:1325</div></div>
<div class="ttc" id="a03603_html_accd31930a2e1ff0b8122cbaa202127d3"><div class="ttname"><a href="a03603.html#accd31930a2e1ff0b8122cbaa202127d3">atcacert_def_s::public_key_dev_loc</a></div><div class="ttdeci">atcacert_device_loc_t public_key_dev_loc</div><div class="ttdoc">Where on the device the public key can be found. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:161</div></div>
<div class="ttc" id="a03534_html_ga240f94a03feb298e5c618677f2962a5a"><div class="ttname"><a href="a03534.html#ga240f94a03feb298e5c618677f2962a5a">atcacert_get_device_data</a></div><div class="ttdeci">int atcacert_get_device_data(const atcacert_def_t *cert_def, const uint8_t *cert, size_t cert_size, const atcacert_device_loc_t *device_loc, uint8_t *device_data)</div><div class="ttdoc">Gets the dynamic data that would be saved to the specified device location. This function is primaril...</div><div class="ttdef"><b>Definition:</b> atcacert_def.c:519</div></div>
<div class="ttc" id="a03534_html_gab4fac3fd2bf5a227140cc3012a4dad02"><div class="ttname"><a href="a03534.html#gab4fac3fd2bf5a227140cc3012a4dad02">atcacert_get_subj_public_key</a></div><div class="ttdeci">int atcacert_get_subj_public_key(const atcacert_def_t *cert_def, const uint8_t *cert, size_t cert_size, uint8_t subj_public_key[64])</div><div class="ttdoc">Gets the subject public key from a certificate. </div><div class="ttdef"><b>Definition:</b> atcacert_def.c:646</div></div>
<div class="ttc" id="a03607_html_abbc4bbcc72558a31f830df7df2df53b8"><div class="ttname"><a href="a03607.html#abbc4bbcc72558a31f830df7df2df53b8">atcacert_build_state_s::max_cert_size</a></div><div class="ttdeci">size_t max_cert_size</div><div class="ttdoc">Max size of the cert buffer in bytes. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:179</div></div>
<div class="ttc" id="a03603_html_ab02a37cdd6671ab98d0124c5b91623b0"><div class="ttname"><a href="a03603.html#ab02a37cdd6671ab98d0124c5b91623b0">atcacert_def_s::cert_sn_dev_loc</a></div><div class="ttdeci">atcacert_device_loc_t cert_sn_dev_loc</div><div class="ttdoc">Only applies when sn_source is SNSRC_STORED or SNSRC_STORED_DYNAMIC. Describes where to get the certi...</div><div class="ttdef"><b>Definition:</b> atcacert_def.h:156</div></div>
<div class="ttc" id="a03534_html_gace8ac017f58840c296fe2cf29bdaa2fe"><div class="ttname"><a href="a03534.html#gace8ac017f58840c296fe2cf29bdaa2fe">atcacert_cert_build_start</a></div><div class="ttdeci">int atcacert_cert_build_start(atcacert_build_state_t *build_state, const atcacert_def_t *cert_def, uint8_t *cert, size_t *cert_size, const uint8_t ca_public_key[64])</div><div class="ttdoc">Starts the certificate rebuilding process. </div><div class="ttdef"><b>Definition:</b> atcacert_def.c:270</div></div>
<div class="ttc" id="a03534_html_gga813047a656af7fe578d28fd54c840e8eaffba4ece10bc933c6b408a2b4e234ab2"><div class="ttname"><a href="a03534.html#gga813047a656af7fe578d28fd54c840e8eaffba4ece10bc933c6b408a2b4e234ab2">SNSRC_DEVICE_SN_HASH</a></div><div class="ttdoc">Cert serial number is the SHA256(Device SN + Encoded dates), with uppermost 2 bits set to 01...</div><div class="ttdef"><b>Definition:</b> atcacert_def.h:74</div></div>
<div class="ttc" id="a03603_html_a2d5a033a5aa1227c536ec1aa71a84fa5"><div class="ttname"><a href="a03603.html#a2d5a033a5aa1227c536ec1aa71a84fa5">atcacert_def_s::comp_cert_dev_loc</a></div><div class="ttdeci">atcacert_device_loc_t comp_cert_dev_loc</div><div class="ttdoc">Where on the device the compressed cert can be found. </div><div class="ttdef"><b>Definition:</b> atcacert_def.h:162</div></div>
<div class="ttc" id="a03534_html_ga4889317187186736e62beb7538b870b2"><div class="ttname"><a href="a03534.html#ga4889317187186736e62beb7538b870b2">atcacert_std_cert_element_t</a></div><div class="ttdeci">enum atcacert_std_cert_element_e atcacert_std_cert_element_t</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_97aefd0d527b934f1d99a682da8fe6a9.html">lib</a></li><li class="navelem"><a class="el" href="dir_26647cdac0a1f8c717d44b4eb3b4ec89.html">atcacert</a></li><li class="navelem"><a class="el" href="a00149.html">atcacert_def.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
  </ul>
</div>
</body>
</html>
